package com.dd.cloud.user.config;


import com.dd.cloud.common.config.common.ProfilesProperties;
import com.dd.cloud.common.constants.OrderConstants;
import com.dd.cloud.common.constants.ZekeConstants;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;

/**
 * 微信接口地址
 *
 * @author admin
 */
@Data
@Configuration
public class OrderPrefix {
    @Autowired
    private ProfilesProperties profilesProperties;

    /**
     * 获取订单前缀
     *
     * @return
     */
    public String getPayPrefix() {
        switch (profilesProperties.getActive()) {
            case ZekeConstants.ProfilesType.DEV:
                return OrderConstants.OrderPayPrefix.DEV;
            case ZekeConstants.ProfilesType.PROD:
                return OrderConstants.OrderPayPrefix.PROD;
            default:
                return OrderConstants.OrderPayPrefix.TEST;
        }
    }

    /**
     * 获取问诊订单号
     */
    public String getPrePayPrefix() {
        switch (profilesProperties.getActive()) {
            case ZekeConstants.ProfilesType.DEV:
                return OrderConstants.PreOrderPayPrefix.DEV;
            case ZekeConstants.ProfilesType.PROD:
                return OrderConstants.PreOrderPayPrefix.PROD;
            default:
                return OrderConstants.PreOrderPayPrefix.TEST;
        }
    }

    /**
     * 获取兑换订单号
     */
    public String getExchangeFix() {
        switch (profilesProperties.getActive()) {
            case ZekeConstants.ProfilesType.DEV:
                return OrderConstants.ExchangeOrderPayFix.DEV;
            case ZekeConstants.ProfilesType.PROD:
                return OrderConstants.ExchangeOrderPayFix.PROD;
            default:
                return OrderConstants.ExchangeOrderPayFix.TEST;
        }
    }

    /**
     * 获取包月服务订单号
     */
    public String getMonthPayPrefix() {
        switch (profilesProperties.getActive()) {
            case ZekeConstants.ProfilesType.DEV:
                return OrderConstants.MonthOrderPayPrefix.DEV;
            case ZekeConstants.ProfilesType.PROD:
                return OrderConstants.MonthOrderPayPrefix.PROD;
            default:
                return OrderConstants.MonthOrderPayPrefix.TEST;
        }
    }

    /**
     * 获取问诊订单号
     */
    public String getWzOrderPayPrefix() {
        switch (profilesProperties.getActive()) {
            case ZekeConstants.ProfilesType.DEV:
                return OrderConstants.WzOrderPayPrefix.DEV;
            case ZekeConstants.ProfilesType.PROD:
                return OrderConstants.WzOrderPayPrefix.PROD;
            default:
                return OrderConstants.WzOrderPayPrefix.TEST;
        }
    }


    /**
     * 获取流水支付前缀
     *
     * @return
     */
    public String getFlowPrefix() {
        switch (profilesProperties.getActive()) {
            case ZekeConstants.ProfilesType.DEV:
                return OrderConstants.FlowPayPrefix.DEV;
            case ZekeConstants.ProfilesType.PROD:
                return OrderConstants.FlowPayPrefix.PROD;
            default:
                return OrderConstants.FlowPayPrefix.TEST;
        }
    }

    /**
     * 获取退款流水前缀
     *
     * @return
     */
    public String getFlowRefundPrefix() {
        switch (profilesProperties.getActive()) {
            case ZekeConstants.ProfilesType.DEV:
                return OrderConstants.FlowRefundPrefix.DEV;
            case ZekeConstants.ProfilesType.PROD:
                return OrderConstants.FlowRefundPrefix.PROD;
            default:
                return OrderConstants.FlowRefundPrefix.TEST;
        }
    }


}
